#ifndef _MAIN_COMMON_H_
#define _MAIN_COMMON_H_

#include "v4l2.hpp"
#include "drm.hpp"
#include "open3man/rockchip/rga.h"
#include "open3man/time.h"
#include <stdlib.h>

int WIDTH;
int HEIGHT;
int FPS;
int FMT;

struct ManV4L2Fmt {
	std::string name;
	std::string rga_fmt_name;
	int rga_fmt;
	int v4l2_fmt;
};

static ManV4L2Fmt man_pixfmt[] = {
	{ "NV12"          ,"RK_FORMAT_YCrCb_420_SP"	, RK_FORMAT_YCrCb_420_SP  ,v4l2_fourcc('N','V','1','2')	},
	{ "NV21"          ,"RK_FORMAT_YCbCr_420_SP"	, RK_FORMAT_YCbCr_420_SP  ,v4l2_fourcc('N','V','2','1')	},
	{ "RGB3"          ,"RK_FORMAT_BGR_888"		, RK_FORMAT_BGR_888       ,v4l2_fourcc('R','G','B','3')	},
	{ "BGR3"          ,"RK_FORMAT_RGB_888"		, RK_FORMAT_RGB_888       ,v4l2_fourcc('B','G','R','3')	},
	{ "UYVY"          ,"RK_FORMAT_YVYU_422"		, RK_FORMAT_YVYU_422      ,v4l2_fourcc('U','Y','V','Y')	},
	{ "NV61"          ,"RK_FORMAT_YCbCr_422_SP"	, RK_FORMAT_YCbCr_422_SP   ,v4l2_fourcc('N','V','6','1')	}
};

#define DRM_FMT RK_FORMAT_RGBA_8888

bool  MAN_DEBUG_CAP = false;
bool  MAN_DEBUG_OUT = false;

#endif
